package com.linkhub.oms.common.util;

import com.linkhub.oms.common.constant.CacheKeyConstant;

import static com.linkhub.oms.common.constant.CacheKeyConstant.*;

/**
 * @Description: CacheKeyAssist
 * @Author: echo
 * @Date: 2024/3/6 18:35
 * @Version: 1.0
 */
public class CacheKeyAssist {

    public static String getEmailCodeKey(String email) {
        return String.format(CacheKeyConstant.EMAIL_CODE_KEY, email);
    }

    public static String getPasswordErrorTimesKey(String email) {
        return String.format(CacheKeyConstant.ACCOUNT_PASSWORD_ERROR_TIMES_KEY, email);
    }

    public static String getWhiteListApprovalLockKey(String email) {
        return String.format(WHITE_LIST_APPROVAL_LOCK_KEY, email);
    }

    public static String getShopifyDataSyncLockKey(String sysShopId, String dataKey) {
        return String.format(SHOPIFY_DATA_SYNC_LOCK_KEY, sysShopId, dataKey);
    }

    public static String getEmployeeOrderApprovalLockKey(String sysOrderId) {
        return String.format(EMPLOYEE_ORDER_APPROVAL_LOCK_KEY, sysOrderId);
    }

    public static String getEmployeeOrderForecastLockKey(String sysOrderId) {
        return String.format(EMPLOYEE_ORDER_FORECAST_LOCK_KEY, sysOrderId);
    }

    public static String getEmployeeOrderPrintLockKey(String sysOrderId) {
        return String.format(EMPLOYEE_ORDER_PRINT_LOCK_KEY, sysOrderId);
    }

    public static String getEmployeePushToWmsLockKey(String sysOrderId) {
        return String.format(EMPLOYEE_ORDER_PUSH_TO_WMS_LOCK_KEY, sysOrderId);
    }

    public static String getWmsRetryLockKey(String id) {
        return String.format(WMS_RETRY_LOCK_KEY, id);
    }

    public static String getProductPreemptionStockLockKey(String skuId) {
        return String.format(PRODUCT_PREEMPTION_STOCK_LOCK_KEY, skuId);
    }

    public static String getProductPassageStockLockKey(String skuId) {
        return String.format(PRODUCT_PASSAGE_STOCK_LOCK_KEY, skuId);
    }

    public static String getLogisticStatusEditLockKey(String channelCode) {
        return String.format(LOGISTIC_STATUS_EDIT_LOCK_KEY, channelCode);
    }

    public static String getLogisticThirdPartUrlEditLockKey(String sysShopId) {
        return String.format(LOGISTIC_THIRD_PART_URL_EDIT_LOCK_KEY, sysShopId);
    }

    public static String getEntryOrderEditLockKey(String entryOrderCode) {
        return String.format(ENTRY_ORDER_EDIT_LOCK_KEY, entryOrderCode);
    }

    public static String getChannelPriorityEditLockKey(String sysShopId, String shippingName) {
        return String.format(CHANNEL_PRIORITY_EDIT_LOCK_KEY, sysShopId, shippingName);
    }

    public static String getLocalProductEditLockKey(String userId, String skuId) {
        return String.format(LOCAL_PRODUCT_EDIT_LOCK_KEY, userId, skuId);
    }

    public static String getPassageStockUpdatedLockKey(String userId, String skuId, String stashId) {
        return String.format(STOCK_PASSAGE_UPDATED_LOCK_KEY, userId, skuId, stashId);
    }

    public static String getPhysicalStockUpdatedLockKey(String userId, String skuId, String stashId) {
        return String.format(STOCK_PHYSICAL_UPDATED_LOCK_KEY, userId, skuId, stashId);
    }

    public static String getPreemptionStockUpdatedLockKey(String userId, String skuId, String stashId) {
        return String.format(STOCK_PREEMPTION_UPDATED_LOCK_KEY, userId, skuId, stashId);
    }

    public static String getOutStockUpdatedLockKey(String userId, String skuId, String stashId) {
        return String.format(STOCK_OUT_UPDATED_LOCK_KEY, userId, skuId, stashId);
    }

    public static String getTrackEventNotifyLocKey(String wayBillNumber) {
        return String.format(TRACK_EVENT_NOTIFY_LOCK_KEY, wayBillNumber);
    }
}
